<script>
if (self==top) window.open("?op=core&fp=logout","_top");
</script>

<table border="0" cellpadding="2" cellspacing="1" width="95%" class=table1>
<tr>
  <td class="bgClc_{gametype}">{gametypeStr} {betname} 下注单</td>
</tr>
<tr>
  <td class=td2>
	<table border="0" cellpadding="2" cellspacing="0" width="100%">
	<tr>
	  <td>会员帐号：</td>
	  <td align="right">{account}</td>
	</tr>
	<tr>
	  <td>额度：</td>
	  <td align="right">{amount}</td>
	</tr>
	<!--<tr>
	  <td>已用额度：</td>
	  <td align="right">{usedamount}</td>
	</tr>-->
  <tr>
	  <td>可用额度：</td>
	  <td align="right">{betamount}</td>
	</tr>
	<tr>
	  <td>下注期数：</td>
	  <td align="right">{round}</td>
	</tr>
	<tr>
	  <td>开奖日期：</td>
	  <td align="right">{open}</td>
	</tr>
	</table>
	<hr><center>
	<font color=red>{betname} {numstr}</font> @ 
  <font color=red><b id="odds">{rate}</b></font> 
	                                              
	<form name="f" id="f" action="{action}" method="post" onsubmit="return chk(this)">
	<input type=hidden name=oldrate value="{rate}">
	<table border=0>
	{message}
  <tr>
	  <td>盘类：</td>
	  <td  align="right" style="color:#006400;font-weight: bold;">{diskStr}
    <input type="hidden" name="disk" value="{disk}" />
	  </td>
	</tr>
	<tr>
	  <td>下注金额：</td>
	  <td><input name="money" size=10 maxlength=8 value="{money}"
      	onkeypress="return KeyNumber()" 
      	onkeyup="calculate();//nmoney.innerText=n2c(this.value);">
	  </td>
	</tr>
	{amountnum}
	<tr>
	  <td>可赢金额：
	  <td id="payoff" style="color:red" align="right">0</td>
	<tr>
	  <td>最低限额：</td>
	  <td align="right"><b>{min}</b></td>
	</tr>
	{oneamount}
	<tr>
	  <td>下注限额：</td>
	  <td align="right"><b>{amount2_str}</b></td>
	</tr>
	<tr>
	  <td colspan=2 align=center>
	    <input type="hidden" value="{palygroup}" name="palygroup" /> 
      <input type="hidden" value="{bettype}" name="bettype" />	    
      <input type="hidden" value="{subid}" name="subid" />
	    <input type="hidden" value="{num}" name="num" />
	    <input type="hidden" value="{gametype}" name="gametype" />
	    <input type=button name=cancel value="取消" onclick="location.replace('op.php?op=member_5h&fp=account&gametype={gametype}')">
	    <input type=submit name=submit value="确定">
	</tr>

	</table>
	</form>
	</p></center>
	</td>
	</tr>
<tr>
  <td align=center class="bgClc_{gametype}"><div id="msg"></div></td>
</tr>    
</table>

<script>
$(function(){
var i = 35;
$.fn.reflashMin = function() {
  if(i > 0){
     $("div#msg").text("赔率更新秒数：" + i);
     i--;
     setTimeout("$().reflashMin()",1000);
  }else{
    window.top.leftFrame.location.href = "op.php?op=member_5h&fp=account&gametype={gametype}";
  }
}
$().reflashMin();
});


function chk(f)
{
    f.submit.disabled = true;
    f.cancel.disabled = true;
	if (f.money.value=="") {
		alert("请输入下注金额！");
		f.money.focus();
        f.submit.disabled = false;
        f.cancel.disabled = false;
		return false;
	}
	var m = parseInt(f.money.value);
	if (m < {min}) {
		alert("下注金额不能小於最低限额！");
		f.money.focus();
        f.submit.disabled = false;
        f.cancel.disabled = false;
		return false;
	}
    if (m > {amount1}) {
    	alert("下注金额不能超过单注限额！");
    	f.money.focus();
        f.submit.disabled = false;
        f.cancel.disabled = false;
    	return false;
    }
	if (m > {betamount}) {
		alert("下注金额不能超过可用额度！");
		f.money.focus();
    f.submit.disabled = false;
    f.cancel.disabled = false;
		return false;
	}
	if (!confirm("是否确定下注？")) {
		f.money.focus();
	    f.submit.disabled = false;
        f.cancel.disabled = false;
		return false;
	}
}

function calculate()
{
	if (f.money.value=="") {
		f.money.focus();
	} else {
		var money = parseFloat(f.money.value);
		var odds = parseFloat(document.all.odds.innerHTML);
		var payoff = Math.round(money*(odds-1));
		document.all.payoff.innerHTML = payoff;
	}
}

function canceldeliver()
{
	location.replace("?op=member_sb&fp=account&gametype={gametype}");
}

function KeyNumber()
{
	if (event.keyCode == 13) return true;
	if ((event.keyCode < 48 || event.keyCode > 57) && (event.keyCode > 95 || event.keyCode < 106)) return false;
}

//var RSecond=35;
//RClockRate();

//f.money.focus();
</script>